package com.tokenplus.thai.earn.withdraw

import android.annotation.SuppressLint
import android.view.View
import androidx.lifecycle.ViewModel
import com.tokenplus.thai.base.BaseActivity
import com.tokenplus.thai.databinding.ActivityWithdrawTransferResultBinding
import com.tokenplus.thai.enums.PageTagEnum
import com.tokenplus.thai.extend.*

/** 交换-结果页 */
@SuppressLint("CustomSplashScreen")
class WithdrawTransferResultActivity : BaseActivity() {

    //布局binding
    private lateinit var mActivityBinding: ActivityWithdrawTransferResultBinding

    override fun onBindingViewModel(): List<ViewModel> {
        val list = mutableListOf<ViewModel>()
        return list
    }

    override fun onBindingViewTag(): String {
        return PageTagEnum.my_wallet.name.uppercase()
    }

    override fun onBindingContentView(): View {
        mActivityBinding =
            ActivityWithdrawTransferResultBinding.inflate(layoutInflater)
        return mActivityBinding.root
    }

    @SuppressLint("NotifyDataSetChanged", "SetTextI18n")
    override fun onContentViewBinded() {
        try {
            //初始化配置参数
            val address = intent.getStringExtra("address").toString()
            val amount = intent.getStringExtra("amount").toString()
            val date = intent.getStringExtra("date").toString()
            val unit = intent.getStringExtra("unit").toString()

            mActivityBinding.textTransferResultAmount.text = amount.toFinanceString() + unit
            mActivityBinding.textTransferResultReceiverValue.text = address
            mActivityBinding.textTransferResultDateValue.text = date

            //点击确认
            mActivityBinding.submitTransferResult.setOnClickListener {
                finish()
            }

        } catch (e: Exception) {
            e.printStackTrace()
        }
    }


}